home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / pc / files / shared.cst / 00502_Script_pano callbacks < prev    next >
Text File  |  1997-07-24  |  7KB  |  200 lines

  1. -- InitPanoCallbacks
  2. --
  3. -- Initializes the callbacks used for panoramic movies.
  4. -------------------------------------------------------------------------------
  5. on InitPanoCallbacks
  6.   global gQTVRInstance
  7.   if IsQTVRMovie(gQTVRInstance) then
  8.     QTVRSetRolloverHotSpotHandler(gQTVRInstance,"sampleRolloverHotSpotHandler")
  9.     --QTVRSetMouseOverHandler(gQTVRInstance,"sampleMouseOverHandler")
  10.     --QTVRSetMouseDownHandler(gQTVRInstance,"sampleMouseDownHandler")
  11.     --QTVRSetPanZoomStartHandler(gQTVRInstance,"samplePanZoomStartHandler")
  12.     --QTVRSetMouseStillDownHandler(gQTVRInstance,"sampleMouseStillDownHandler")
  13.     --QTVRSetNodeLeaveHandler(gQTVRInstance,"sampleNodeLeaveHandler")
  14.     
  15.     --QTVRSetRolloverHotSpotHandler(gQTVRInstance,empty)
  16.     QTVRSetMouseOverHandler(gQTVRInstance,empty)
  17.     QTVRSetMouseDownHandler(gQTVRInstance,empty)
  18.     QTVRSetPanZoomStartHandler(gQTVRInstance,empty)
  19.     QTVRSetMouseStillDownHandler(gQTVRInstance,empty)
  20.     QTVRSetNodeLeaveHandler(gQTVRInstance,empty)
  21.   end if
  22. end
  23.  
  24.  
  25. --=============================================================================
  26. -- XCMD Callback Factory
  27. -------------------------------------------------------------------------------
  28.  
  29.  
  30.  
  31. --=============================================================================
  32. -- CallBackTracer
  33. --
  34. -- As described in "Using Lingo", Appendix A.  Pass any mSendCardMessage
  35. -- commands on to Lingo so that callbacks can be handled.
  36. -------------------------------------------------------------------------------
  37. factory CallBackTracer
  38.   
  39. method mNew
  40.   
  41. method mEvalExpr pExpr
  42.   
  43. method mSendHCMessage pMessage
  44.   
  45. method mSendCardMessage pMessage
  46.   do pMessage
  47.   
  48. method mGetFieldByName pCard, pName
  49.   
  50. method mGetFieldByNum pCard, pNum
  51.   
  52. method mGetFieldByID pCard, pID
  53.   
  54. method mSetFieldByName pCard, pName, pValue
  55.   
  56. method mSetFieldByNum pCard, pNum, pValue
  57.   
  58. method mSetFieldByID pCard, pID, pValue
  59.   
  60. end
  61.  
  62.  
  63. --=============================================================================
  64. -- Routines used by Pano Callbacks screens
  65. -------------------------------------------------------------------------------
  66.  
  67.  
  68. on TestMouseOverHandler
  69.   global gQTVRInstance
  70.   if IsQTVRMovie(gQTVRInstance) then
  71.     put "In mouse over at: " & the ticks into member "MouseOverHandler Message"
  72.   end if
  73. end
  74.  
  75. on TestRolloverHotSpotHandler pHotSpotID
  76.   global gQTVRInstance
  77.   if IsQTVRMovie(gQTVRInstance) then
  78.     if pHotSpotID = 0 then
  79.       put "ID: " & pHotSpotID & RETURN & "Name:" into member "RolloverHotSpotHandler Message"
  80.     else
  81.       QTVRSetHotSpotID(gQTVRInstance, integer(pHotSpotID))
  82.       set spotName = QTVRGetHotSpotName(gQTVRInstance)
  83.       put "ID: " & pHotSpotID & RETURN & "Name: " & spotName into member "RolloverHotSpotHandler Message"
  84.     end if
  85.   end if
  86. end
  87.  
  88. on TestMouseDownHandler
  89.   global gQTVRInstance
  90.   if IsQTVRMovie(gQTVRInstance) then
  91.     put "In mouse down at: " & the ticks into member "MouseDownHandler Message"
  92.     QTVRPassMouseDown(gQTVRInstance)
  93.   end if
  94. end
  95.  
  96. on TestPanZoomStartHandler
  97.   global gQTVRInstance
  98.   if IsQTVRMovie(gQTVRInstance) then
  99.     put "In pan zoom start at: " & the ticks into member "PanZoomStartHandler Message"
  100.   end if
  101. end
  102.  
  103. on TestMouseStillDownHandler
  104.   global gQTVRInstance
  105.   if IsQTVRMovie(gQTVRInstance) then
  106.     put "In mouse still down at: " & the ticks into member "MouseStillDownHandler Message" 
  107.     put RETURN & QTVRGetPanAngle(gQTVRInstance) after member "MouseStillDownHandler Message"
  108.   end if
  109. end
  110.  
  111. on TestNodeLeaveHandler pToNode
  112.   global gQTVRInstance
  113.   if IsQTVRMovie(gQTVRInstance) then
  114.     put "Leaving node ID: " & pToNode into member "NodeLeaveHandler Message"
  115.   end if
  116. end
  117.  
  118.  
  119.  
  120. --=============================================================================
  121. -- Sample PanoMovie callback handler routines
  122. -------------------------------------------------------------------------------
  123.  
  124. --=============================================================================
  125. -- SampleMouseOverHandler
  126. --
  127. -- Called by PanoMovie periodically during mouseOver.
  128. -------------------------------------------------------------------------------
  129. on SampleMouseOverHandler
  130.   put "Mouse over panoramic movie"
  131.   -- If you want to exit from mouseOver, use this line
  132.   global gQTVRInstance
  133.   if IsQTVRMovie(gQTVRInstance) then
  134.     -- QTVRExitMouseOver(gQTVRInstance)
  135.   end if
  136. end
  137.  
  138. --=============================================================================
  139. -- SampleRolloverHandler
  140. --      pHotSpotID is the id of the hot spot the user is over
  141. --
  142. -- Called by PanoMovie whenever the hot spot the cursor is over changes.
  143. -------------------------------------------------------------------------------
  144. on SampleRolloverHotSpotHandler pHotSpotID
  145.   global gQTVRInstance
  146.   
  147.   --  put QTVRGetHotSpotID(gQTVRInstance) into member "Current Hot Spot ID"
  148.   put pHotSpotID into cast "Current Hot Spot ID"
  149. end
  150.  
  151.  
  152. --=============================================================================
  153. -- SampleMouseDownHandler
  154. --
  155. -- Called by PanoMovie when a mouseDown event occurs during a mouseOver call
  156. -------------------------------------------------------------------------------
  157. on SampleMouseDownHandler
  158.   put "Mouse down during mouseOver call"
  159.   
  160.   global gPanoMovieID
  161.   if IsQTVRMovie(gQTVRInstance) then
  162.     QTVRPassMouseDown(gQTVRInstance)
  163.   end if
  164. end
  165.  
  166. --=============================================================================
  167. -- SamplePanZoomStartHandler
  168. --
  169. -- Called once by PanoMovie when the user starts to pan or zoom.
  170. -------------------------------------------------------------------------------
  171. on SamplePanZoomStartHandler
  172.   put "About to pan or zoom in panoramic movie"
  173. end
  174.  
  175. --=============================================================================
  176. -- SampleMouseStillDownHandler
  177. --
  178. -- Called by PanoMovie periodically during while the mouse is down within
  179. -- mouseOver or mouseDown.
  180. -------------------------------------------------------------------------------
  181. on SampleMouseStillDownHandler
  182.   put "Enter mouse still down from panoramic movie"
  183.   global gQTVRInstance
  184.   if IsQTVRMovie(gQTVRInstance) then
  185.     -- put QTVRGetPanAngle(gQTVRInstance) into tPanAngle 
  186.     -- put "PanAngle is currently: " & tPanAngle
  187.   end if
  188.   put "Leave mouse still down from panoramic movie"
  189. end
  190.  
  191. --=============================================================================
  192. -- SampleNodeLeaveHandler
  193. --      pToNodeID is the id of the node the user is leaving
  194. --
  195. -- Called by PanoMovie when the user moves between nodes by clicking on link
  196. -- hot spots.
  197. -------------------------------------------------------------------------------
  198. on SampleNodeLeaveHandler pToNode
  199.   put "Jumping to node " & pToNode & " in panoramic movie"
  200. end